//
//  ImportAreaItemModel.m
//  Utils
//
//  Created by enghou on 2018/6/7.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "ImportAreaItemModel.h"

@implementation ImportAreaItemModel
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.creator = source[@"createUser"];
        self.time = source[@"createDate"];
        NSMutableArray *array = [NSMutableArray array];
        NSArray *files = source[@"files"];
        for (NSDictionary *element in files) {
            MediaItemModel *m = [[MediaItemModel alloc]initWithSource:element];
            [array addObject:m];
        }
        self.files = array;
        NSDictionary *problem = source[@"securityProblems"];
        self.question = problem[@"displayName"];
        self.typeName = source[@"involvedType"][@"displayName"];
        self.area = source[@"securityKeyAreas"];
        self.ids = source[@"id"];
        if (self.files.count == 0) {
            self.height = 110;
        }else{
            self.height = 110 + 100;
        }
    }
    return self;
}
@end
